package indi.kider.server.woniubus.api;

import indi.kider.common.model.woniubus.CntReportVo;
import indi.kider.server.woniubus.service.CntReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import pers.vankid.common.model.base.CommonResponse;

/**
 * 公寓每日入住率统计
 */
@RestController
@RequestMapping(value = "cntReport")
public class CntReportController {

    @Autowired
    private CntReportService cntReportService;

    /**
     * 按公寓抽取统计数据
     * @return
     * @throws Exception
     */
    @PostMapping(value = "batchInsertCntReport")
    public CommonResponse batchInsertCntReport() throws Exception {
        return cntReportService.batchInsertCntReport();
    }

    @PostMapping(value = "selcetDataByDay")
    public CommonResponse selcetDataByDay(@RequestBody CntReportVo cntReportVo) throws Exception {
        return cntReportService.selcetDataByDay(cntReportVo);
    }

    @PostMapping(value = "selcetDataByMonth")
    public CommonResponse selcetDataByMonth(@RequestBody CntReportVo cntReportVo) throws Exception {
        return cntReportService.selcetDataByMonth(cntReportVo);
    }
    @PostMapping(value = "selcetDataByMonthGroupByYear")
    public CommonResponse selcetDataByMonthGroupByYear(@RequestBody CntReportVo cntReportVo) throws Exception {
        return cntReportService.selcetDataByMonthGroupByYear(cntReportVo);
    }
}
